﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Management;

namespace HyperVSnapin.Object
{
    public abstract class HyperVObject
    {
        private ManagementObject wmiObject;

        protected internal ManagementObject ManagmenetObject
        {
            get { return wmiObject; }
        }

        protected internal HyperVObject(ManagementObject mo)
        {
            this.wmiObject = mo;
        }

        /// <summary>
        /// Short textual description (one-line string) of the object.
        /// </summary>
        public virtual string Caption
        {
            get
            {
                return wmiObject.Properties["Caption"].Value.ToString();
            }
        }

        /// <summary>
        /// Textual description of the object.
        /// </summary>
        /// <remarks>Set to "Microsoft Virtual Computer System" if the instance represents a virtual system or "Microsoft Hosting Computer System" if the instance represents the host system</remarks>
        public virtual string Description
        {
            get
            {
                return wmiObject.Properties["Description"].Value.ToString();
            }
        }

        /// <summary>
        /// Label by which the object is known.
        /// </summary>
        /// <value></value>
        public virtual string Name
        {
            get
            {
                return wmiObject.Properties["Name"].Value.ToString();
            }
        }
    }
}
